package com.famdoc.Mapper;

import com.famdoc.Pojo.entity.Patient;
import com.famdoc.Pojo.params.IndexBodyParams;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface IndexMapper {
    int getTodayAddSign(@Param("doctorId") int doctorId,
                           @Param("startOfDay")LocalDateTime startOfDay,
                           @Param("endOfDay")LocalDateTime endOfDay);

    int getTotalVisited(@Param("doctorId") int doctorId);

    int getTotalSign(@Param("doctorId")int doctorId);

    int getNearlyDue(@Param("doctorId")int doctorId,
                     @Param("now") LocalDateTime now,
                     @Param("nearlyDueTime") LocalDateTime nearlyDueTime);

    int getNearlyWeekDue(@Param("doctorId")int doctorId,
                         @Param("now")LocalDateTime now,
                         @Param("nearlyWeekDueTime")LocalDateTime nearlyWeekDueTime);

    int getTotalDue(@Param("doctorId")int doctorId,
                    @Param("now")LocalDateTime now);

    List<String> getCrowdNames();

    int getFirstVisit(IndexBodyParams indexBodyParams);

    int getTodayVisit(IndexBodyParams indexBodyParams);

    int getWeekVisit(IndexBodyParams indexBodyParams);

    int getDueVisit(IndexBodyParams indexBodyParams);

    List<Patient> getAllNearlyDueByKeyWord(@Param("doctorId")int doctorId,
                                           @Param("keyword") String keyword,
                                           @Param("now")LocalDateTime now,
                                           @Param("nearlyWeekDueTime")LocalDateTime nearlyWeekDueTime);

    List<Patient> getAllDueByKeyWord(@Param("doctorId")int doctorId,
                                     @Param("keyword") String keyword,
                                     @Param("now")LocalDateTime now);

    List<Patient> getFirstVisitPatientByCrowd(IndexBodyParams indexBodyParams);

    List<Patient> getTodayVisitPatientByCrowd(IndexBodyParams indexBodyParams);

    List<Patient> getWeekVisitPatientByCrowd(IndexBodyParams indexBodyParams);

    List<Patient> getDueVisitPatientByCrowd(IndexBodyParams indexBodyParams);
}
